/**
 * 
 */
$(initbase());
function initbase() {
	$.ajax({
		type : "post",
		url : "GetCoopStatisticsServlet",
		data : {
			projID : projID,
			team_id : team_id
		},
		dateType : "json",
		success : function(data) {
			var jsondata = eval('(' + data + ')');
			
			$("#nowTime").text(jsondata.newTime);
			$("#taskcount").text(jsondata.taskNum);
			$("#nodoneNum").text(jsondata.nodoneNum);
			$("#delayrate").text(jsondata.delayRate);
			var table=$("#statetable");
			$.each(jsondata.taskNumArray, function(n, v) {
				var ndNum=0 , ratio;
				$.each(jsondata.noDoneNumArray, function(num, value) {
					if(v.executor==value.executor){
						ndNum=value.tasknum
					}
				});
				ratio=ndNum/(v.tasknum);
				table.append("<tbody><tr>"+
								"<td class=\"member\"><img src=\"../userIcons/"+v.userIcon+"\""+
									"alt=\""+v.userNickName+"\" class=\"avatar\"> <span class=\"name\">"+v.userNickName+"</span></td>"+
								"<td class=\"todo\">"+
									"<div class=\"stat\">"+
										"<span class=\"count\">"+v.tasknum+"</span>"+
										"<div class=\"bar\" style=\"width: Infinity%\">"+
										"<div class=\"inner-bar\" style=\"width: 50%\"></div>"+
										"</div></div></td>"+
										"<td class=\"ratio\"><span>"+(ratio*100).toFixed(1)+"</span></td>"+
									"</tr></tbody>");
			});

		},
		error : function() {
			// TODO do something
		}
	})
}